package com.ntanh.mealplanner.main;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import com.ntanh.mealplanner.R;
import com.ntanh.mealplanner.main.planner.FragmentPlanner;

public class TabPagerAdapter extends FragmentPagerAdapter {

	public TabPagerAdapter(FragmentManager fm) {
		super(fm);
	}

	@Override
	public Fragment getItem(int index) {
		Fragment fragment = null;
		switch (index) {
			case 0:
				fragment = new FragmentPlanner();
				break;
			case 1:
				fragment = new FragmentRecipe();
				break;
			case 2:
				fragment = new FragmentGrocery();
				break;
			case 3:
				fragment = new FragmentMyPlan();
				break;
			default:
				break;
		}

		return fragment;
	}

	@Override
	public int getCount() {
		return 4;
	}

}
